class ObjectUtil {
    public static isNull(obj: any): boolean {
        return obj === null;
    }

    public static isUndef(obj: any): boolean {
        return obj === undefined;
    }

    public static hasKey(object: Record<string, any>, key: string): boolean {
        const keys = Object.keys(object);
        return keys.includes(key);
    }

    public static isEmpty(object: any) {
        if (typeof object !== 'object') {
            return (ObjectUtil.isUndef(object) || ObjectUtil.isNull(object));
        }
        return (ObjectUtil.isUndef(object) || ObjectUtil.isNull(object) || Object.keys(object).length === 0);
    }
}

export default ObjectUtil;